package com.github.llyb120.dsl

import org.junit.jupiter.api.Test

/**
 * @Author: Administrator* @Date: 8/25/2021 4:07 PM
 */
class ColTest {

    static class ColDsl extends AbstractDslMaker{

        DslParser createParser() {
            return parser{
                element {
                    name "report"
                    property {
                        name "col"
                        multiple true
                        type Object
                    }
                    property {
                        name "datasource"
                    }
                    property {
                        name "params"
                        type Map
                    }
                }
                element {
                    constructor  "en", "cn"
                    constructor  "cn"
                    name("col")
                    property {
                        name "calculate"
                        type Closure.class
                    }
                    property {
                        name "en"
                    }
                    property {
                        name "cn"
                    }
                    property {
                        name "params"
                        type Map
                    }
                }
            }
        }
    }

    @Test
    void t(){
        new ColDsl().generate("D:\\work\\flow\\src\\main\\groovy\\com\\github\\llyb120\\report", "com.github.llyb120.report")
    }
}
